home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01oop.zip / CPPWKBK / CPPV4-1.CPP < prev    next >
C/C++ Source or Header  |  1992-08-25  |  592b  |  28 lines

  1. #define HEADER "C++ Problem 4.1 by Rick Conn using Borland C++"
  2.  
  3. #include <stdio.h>
  4. #include "cppv4-1.h"
  5.  
  6. void main(void)
  7. {
  8.   printf("%s\n", HEADER);
  9.  
  10.   complex a("A"), b("B", 2.0, 3.0), c("C");
  11.  
  12.   a = b;
  13.   printf("A = B\n");
  14.   a.print(); b.print(); c.print();
  15.   a.set(5.0, -4.0);
  16.   printf("A = 5 - 4i\n");
  17.   a.print(); b.print(); c.print();
  18.   c = a + b;
  19.   printf("C = A + B\n");
  20.   a.print(); b.print(); c.print();
  21.   c = a - b;  
  22.   printf("C = A - B\n");
  23.   a.print(); b.print(); c.print();
  24.   c = a * b;
  25.   printf("C = A * B\n");
  26.   a.print(); b.print(); c.print();
  27. }
  28.